
import { get } from "vant/lib/utils";
import request from "./request.js";
import axios from "axios";
// 搜索页面
// 搜索接口
export let getSearchs = (obj) => request.get('/drugstore/product/search', { params: obj })
// 说明书接口
export let getInfos = (id) => request.get("/shop/product/detail?id=" + id)


// 首页
// 首页医生列表接口
export let getDoctors = (obj) => request.get('/doctor/doctor/get_list', { params: obj })
// 轮播图接口
export let getBanners = () => request.get("/recommend/data/get_list_by_space?space_id=50")
// 快速找医生接口
export let getTabs = () => request.get('/doctor/doctor/skills')


// 医生页面
//医生详细信息接口
export let getDoctorInfos = (user_id) => request.get('/doctor/doctor/get_info?doctor_user_id=' + user_id)
//详细价格信息接口
export let getDoctorPrices = (user_id) => request.get('/consult/dpackage/ad?doctor_user_id=' + user_id)
//医生擅长列表
export let getGoodsDoctors = (obj) => request.get('/search/doctor/groupby', { params: obj })
// 问诊病例接口
export let getCases = (obj) => request.get('/doctor/case/get_list', { params: obj })
// 宠主评价
export let getComments = (obj) => request.get('/doctor/evaluate/get_list', { params: obj })


// 问宠医接口
// 宠医列表
export let getAskDoctorLists = (obj) => request.get('/doctor/doctor/get_list', { params: obj })


//健康馆首页
// 首页商品列表接口
export let getShopLists = (obj) => request.get('/shop/product/get_list', { params: obj })
//限时抢购列表
export let getFlashSales = () => request.get('/shop/home')
// 全部分类
export let getSelectAll = () => request.get('/shop/category/get_tree_list')
// 商品详情
export let getProDetails = (id) => request.get('/shop/product/detail?id=' + id)
// 能不能吃
export let getEats = (obj) => request.get('/nbnc/data/get_list', { params: obj })

// 登录
//请求图形验证码
export let getKeyImg = () => request.get('/verify/captcha/get_key_and_img');

// 验证图形验证码 发送短信验证码
export let sendLogin = (data) => request.post('/message/vercode/send_login', data);

// 登录注册方法
export let login = (data) => request.post('/auth/login/vercode', data);


// 购物车
//页面购物车微标接口
export let getCarts = () => request.get('/shop/cart/get_count')
//加入购物车  
export let getAdds = (obj) => request.post('/shop/cart/add', obj)

// 购物车列表接口
export let getCartLists = () => request.get('/shop/cart/get_list')
// 购物车全选接口
export let getAllSelects = (obj) => request.post('/shop/cart/batch_update_select', obj)
// 购物车商品修改接口
export let getUpdatePros = (obj) => request.post('/shop/cart/update', obj)
// 商品删除接口
export let getRemovePros = (obj) => request.post('/shop/cart/batch_remove', obj)
// 结算接口
// address_id   remark
export let getBuys = (obj) => request.post('/shop/buy/preview', obj)
// 创建地址接口
/* 
city_code:"410100"
city_name:"郑州"
default:0
detail:"荣邦程"
district_code:"410102"
district_name:"中原区"
name:"丁佩浈"
phone:"13071007437"
province_code:"410000"
province_name:"河南"
*/
export let getCreateAddress = (obj) => request.post('/user/shipping_address/create', obj)
// 收货地址接口
export let getAddressLists = (obj) => request.get('/user/shipping_address/get_list', { params: obj })
//城市请求
export let getCitys = () => axios.get('https://cdn.moguvet.com/custom/front/regionlist/region.json')
//地址详情接口
export let getRemoveAddress = (obj) => request.post('/user/shipping_address/remove', obj)
// 创建订单接口
// platform   remark
export let getCreateOrders = (obj) => request.post('/shop/buy/create_order', obj)

